<template>
	<view class="">
		<view class="indexheader">

			<slot name="slot1" ></slot>
			<view class="indexheader-left">
				<view class="search">
					
					<slot name="slot2" ></slot>
				</view>
				<view class="add">
					
					<slot name="slot3" ></slot>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				
			}
		},
		methods:{
			getheaderheight(){
				const query = uni.createSelectorQuery().in(this);
					query
					  .select(".indexheader")
					  .boundingClientRect((data) => {
						  
						this.$emit("getheaderheightdata",data.height+data.top);
					  })
					  .exec();
			}
		},
		mounted() {
			this.getheaderheight()
		}
	}
</script>

<style lang="scss" scoped>
	.indexheader{
		display: flex;
		z-index: 999;
		position: fixed;
		left: 0;
		top: 0;
		height: 80rpx;
		background-color: $uni-bg-color;
		margin-top: var(--status-bar-height);
		
		width: 100%;
		border-bottom: 1rpx solid #a6a5a8;
		
		.indexheader-center{
			position: absolute;
			right: 50%;
			top: 20%;
		}
		.indexheader-left{
			display: flex;
			position: absolute;
			left: 75%;
			top: 15%;
			.search{
				padding: 5rpx 20rpx 0;
			}
			.add{
				padding: 5rpx 15rpx 0;
			}
			.indexheader-left-img{
				width: 48rpx;
				height: 48rpx;
			}
		}
	}
</style>